<?php TPL::output('admin/global/header.tpl.htm'); ?>

<!--left-->
<?php TPL::output('admin/global/left.tpl.htm'); ?>
<!--left-->

<!-- main -->
<div id="main-content">
	<div class="clear"></div>
	<div class="content-box">
		<div class="content-box-header">
			<h3><?php echo $this->crumb['last']['name']; ?></h3>
			<ul class="content-box-tabs">
				<li><a href="admin/question/report_list/status-0" class="<?php if($_GET['status'] == 0){ ?>default-tab current<?php } ?>">最新举报</a></li>
				<li><a href="admin/question/report_list/status-1" class="<?php if($_GET['status'] == 1){ ?>default-tab current<?php } ?>">已处理</a></li>
			</ul>
			<div class="clear"></div>
		</div>
		<div class="content-box-content">
			<div class="tab-content default-tab" id="tab1">
				<?php if(!$this->list){ ?>
				<div class="notification attention png_bg"> <a href="javascript:;" class="close"><img src="<?php echo G_STATIC_URL;?>/admin/images/icons/cross_grey_small.png" title="Close this notification" alt="close" /></a>
					<div> 没有内容 </div>
				</div>
				<?php }else{ ?>
				<form action="admin/question/report_batch/" onsubmit="return false;" method="post">
				<input name="action_type" id="action_type" type="hidden" value="" />
				<table class="list">
					<thead>
						<tr>
							<th></th>
							<th>地址</th>
							<th>理由</th>
							<th>时间</th>
							<th>举报人</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody style="border-bottom: 1px solid #ddd;">
						<?php foreach ($this->list AS $key => $val) { ?>
						<tr>
							<td><input name="report_ids[]" value="<?php echo $val['id']; ?>" type="checkbox" /></td>
							<td align="left"><a href="<?php echo $val['url']; ?>" target="_blank"><?php echo $val['url']; ?></a></td>
							<td><?php echo $val['reason']; ?></td>
							<td><?php echo date("Y-m-d H:i:s", $val['add_time']); ?></td>
							<td><a href="people/<?php echo $val['user']['url_token']; ?>" target="_blank"><?php echo $val['user']['user_name']; ?></a></td>
							<td><?php if($_GET['status'] == 1){ ?>已处理<?php }else{ ?><a href="javascript:;" onclick="ajax_request(G_BASE_URL + '/admin/question/report_batch/', 'action_type=handle&report_ids[]=<?php echo $val['id']; ?>')">处理</a><?php } ?></td>
						</tr>
						<?php } ?>
					</tbody>
					<tfoot>
						<tr>
							<td colspan="6">
								<input type="checkbox" class="check-all">全选&nbsp;&nbsp;<input type="button" value="  删除  " onclick="$('#action_type').val('delete');ajax_post($(this).parents().find('form'), _form_process);" class="button">
								<?php if($_GET['status'] == 0){ ?>&nbsp;&nbsp;
									<input type="button" value="处理选中" onclick="$('#action_type').val('handle');ajax_post($(this).parents().find('form'), _form_process);" class="button">
								<?php } ?>
								<div class="pagination" style=" width:500px;float:right;"> <?php echo $this->pagination; ?> </div>
								<div class="clear"></div>
							</td>
						</tr>
					</tfoot>
				</table>
				</form>
				<?php } ?>
			</div>
		</div>
		<div class="clear"></div>
		<div id="notf_tip" style="display:none;" class="notification png_bg"> <a href="javascript:;" class="close"><img src="<?php echo G_STATIC_URL;?>/admin/images/icons/cross_grey_small.png" alt="关闭" /></a>
			<div id="notf_cont"></div>
		</div>
	</div>

<!-- footer -->
<?php TPL::output('admin/global/footer.tpl.htm'); ?>
<!-- footer -->

</div>
<!-- main -->

</div>

</body>
</html>